<!DOCTYPE html>
<#assign ctx=Session.basePath>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>事故险情报告</title>
    <script>
        var shipid = '<#if shipid??>${shipid}<#else></#if>';
        var company =  '<#if company??>${company}<#else></#if>';
    </script>
    <link href="${ctx}/easyui/themes/bootstrap/easyui.css" rel="stylesheet" />
    <link href="${ctx}/easyui/themes/icon.css" rel="stylesheet" />
    <script src="${ctx}/js/jquery-1.12.2.min.js"></script>
    <script src="${ctx}/easyui/jquery.easyui.min.js"></script>
    <script src="${ctx}/easyui/locale/easyui-lang-zh_CN.js"></script>

</head>
<body>

<div id="tb" style="padding:5px;height:auto">
    <div>
        开始时间: <input id="stime" class="easyui-datebox" style="width:120px">
        结束时间: <input id="etime" class="easyui-datebox" style="width:120px">
        船舶名称:<input id="shipName" class="easyui-text" style="120px">
        <a href="#" class="easyui-linkbutton btn-search" iconCls="icon-search" style="width: 80px;">查找</a>
    </div>
</div>

<table id="dg"
       data-options="rownumbers:true,singleSelect:true,pagination:true,url:'${ctx}/manage/report/accident/report/ajax/list?shipid=<#if shipid??>${shipid}<#else></#if>&company=<#if company??>${company}<#else></#if>',method:'post',toolbar:'#tb'">
    <thead>
    <tr>
        <th data-options="field:'dateReportStr',width:90">报告日期</th>
        <th data-options="field:'shipName',width:150">船舶</th>
        <th data-options="field:'accidentType',width:130">险情类型</th>
        <th data-options="field:'location',width:80,align:'right'">事故地点</th>
        <th data-options="field:'accidentTimeStr',width:140,align:'right'">事故发生时间</th>
        <th data-options="field:'progressEvents',width:140">事故经过</th>
        <th data-options="field:'dealResult',width:90,align:'center'">处理情况</th>
    </tr>
    </thead>
</table>
<script type="text/javascript">
    $(function(){
        var pager = $('#dg').datagrid({
            fitColumns:true,
            fit: true,
            loadFilter: function(data){
                if(data != null && data.rows != null){
                    for(var i = 0; i < data.rows.length; i++){
                        var record = data.rows[i];
                        record.shipName = record.ship.shipName;
                    }
                }
                return data;
            }
        });	// get the pager of datagrid

        $(".btn-search").click(function () {
            $('#dg').datagrid("load",{
                stime : $("#stime").datebox('getValue'),
                etime : $("#etime").datebox('getValue'),
                shipName : $("#shipName").val()
            })
        })

    })
</script>


</body>
</html>